using System.Collections.Generic;
using System.IO;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using Rhino.Mocks;
using Pronghorn.Core;

namespace ViewEngine_Tests
{
	[TestFixture]
	public class CollectionRenderer_Tests
	{
		[Test]
		public void A_Collection_renderer_should_call_the_render_method_of_the_Irenderable_and_pass_the_TextWriter()
		{
			var textWriter = new StringWriter();
			var mockedIRenderable = MockRepository.GenerateMock<IRenderable>();
			mockedIRenderable.Expect(m => m.Render(textWriter));
			var list = new List<IRenderable>
			               {
			                   mockedIRenderable
			               };
			var collectionRendered = new CollectionRenderer();
			collectionRendered.Render(list, textWriter);
			mockedIRenderable.VerifyAllExpectations();
		}
	}
}